clear all
set emptycells drop
set matsize 11000
set maxvar 32670

*Set working directory
if c(username)=="" { //insert username
cd "" // insert root path
}

if c(username)=="jonathancolmer" { 
	cd "/Users/jonathancolmer/The Lab Dropbox/Jonathan Colmer/ShotSpotter_env/Journal_submissions/ReStat/Replication Folder" 
}

if c(username)=="jmc4qg" { 
	cd "/Users/jmc4qg/The Lab Dropbox/Jonathan Colmer/ShotSpotter_env/Journal_submissions/ReStat/Replication Folder" 
}

use "Raw Data/Policy Data/gunpolicy.dta", clear

gen may_issue = 0
replace may_issue = 1 if concealed_carry == 3

gen prohibited = 0
replace prohibited = 1 if concealed_carry == 4

gen more_prohibited = 0 
replace more_prohibited = 1 if prohibited == 1 | may_issue == 1

collapse (max) more_prohibited, by(state year)
collapse (sum) more_prohibited, by(year)

keep if year >= 1991
tsset year
#delimit ;
tw tsline more_prohibited, 
ylabel(0(10)50,labsize(large)) xlabel(1991(5)2016,ang(45) labsize(large)) xtitle("Year", size(large)) ytitle("Number of States with" "More Prohibitive Policies", size(large)) graphregion(fcolor(255 255 255)) graphregion(lcolor(255 255 255)) 
lcolor(black) lwidth(medthick) xsize(8.6);
#delimit cr
graph export "Figures and Tables/Figure_1/Figure_1.png", replace
